<?php
/**
 * Created by PhpStorm.
 * User: R.Ice
 * Date: 2018/8/23
 * Time: 11:44
 * name:新增课程
 * url:/erpCourse/add_course
 */

$oc_name        = $route->bodyParams['oc_name'];                                 //课程名称
$oc_ocid        = $route->bodyParams['oc_ocid'];                                 //所属的分类ID
$oc_oesid       = $route->bodyParams['oc_oesid'];                                //机构id
$oc_type        = $route->bodyParams['oc_type'];                                 //课程类型（0-课时 1-包月）
$oc_course_type = $route->bodyParams['oc_course_type'];                          //课程类型（0-课时 1-包月）
$oc_years       = $regexpObj->bodyV($response,$route,'oc_years','NORMAL');       //年限
$oc_quarter     = $regexpObj->bodyV($response,$route,'oc_quarter','NORMAL');     //季度
$is_view        = $regexpObj->bodyV($response,$route,'is_view','NORMAL');


//写入数组
$insertArr = [
    'oc_name'        =>$oc_name,
    'oc_ocid'        =>$oc_ocid,
    'oc_oesid'       =>$oc_oesid,
    'oc_type'        =>$oc_type,
    'is_view'        =>$is_view,
    'oc_years'       =>$oc_years,
    'oc_quarter'     =>$oc_quarter,
    'oc_course_type' =>$oc_course_type,
];
//执行写入语句
$rsData = $db->mysqlDB->insert("oa_course",$insertArr);

//返回成功结果
$response->responseData( true, $rsData );